//
//  MyCell.m
//  Project
//
//  Created by 冯东辉 on 2018/9/19.
//  Copyright © 2018年 FengDongHui. All rights reserved.
//

#import "MyCell.h"

@implementation MyCell

- (void)awakeFromNib {
    
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    
    [super setSelected:selected animated:animated];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        [self initSubViews];
    }
    return self;
}

- (void)initSubViews {
    
    _baseV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, GET_SCREEN_WIDTH(), 50)];
    _baseV.backgroundColor = UICOLOR_HEX(0xffffffff);
    [self.contentView addSubview:_baseV];
    
    _icon = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 40, 50)];
    _icon.contentMode = UIViewContentModeCenter;
    [_baseV addSubview:_icon];
    
    _title = [[UILabel alloc] initWithFrame:CGRectMake(_icon.right, 0, GET_SCREEN_WIDTH()-40, 50)];
    _title.textColor = UICOLOR_HEX(0xff000000);
    _title.textAlignment = NSTextAlignmentLeft;
    _title.font = [UIFont systemFontOfSize:16];
    [_baseV addSubview:_title];
}

- (void)reloadDataWith:(NSArray *)data imageData:(NSArray *)imageData indexPath:(NSIndexPath *)indexPath {
    
    _icon.image = [UIImage imageNamed:imageData[indexPath.row]];
    _title.text = data[indexPath.row];
}

@end
